package controller;

import java.util.List;
import model.Product;
import service.ProductService;

public class ProductController {
    private ProductService productService;

    public ProductController(ProductService productService) {
        this.productService = productService;
    }

    public void addProduct(Product product) {
        this.productService.addProduct(product);
    }

    public Product getProduct(int id) {
        return this.productService.getProduct(id);
    }

    public void updateProduct(Product product) {
        this.productService.updateProduct(product);
    }

    public void deleteProduct(int id) {
        this.productService.deleteProduct(id);
    }

    public List<Product> listProducts() {
        return this.productService.listProducts();
    }
}
